package cn.jg.web.controller.sys.request;

import cn.jg.framework.common.bean.Converter;
import cn.jg.model.sys.Company;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * Created by admin on 2023/06/06.
 */
@Data
public class CompanyCreateRequest implements Converter<CompanyCreateRequest, Company> {

    /**
     * id
     */
    private Integer id;

    /**
     * 0,个人1,企业2,机构
     */
    private Integer type;

    /**
     * 名称
     */
    private String name;

    /**
     * 详情
     */
    private String details;

    @Override
    public Company convert(CompanyCreateRequest request) {
        Company company = CompanyMapper.INSTANCE.convert(request);
        return company;
    }

    @Mapper
    interface CompanyMapper {
        CompanyMapper INSTANCE = Mappers.getMapper(CompanyMapper.class);

        Company convert(CompanyCreateRequest request);
    }
}